<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Users extends Admin {
	
	public function __construct()
    {
        parent::__construct();
		$this->load->model("user_model");
    }
	public function index()
	{
		$data = array();
        $page = $this->uri->segment(4);
        $page_size = $this->getPageSize;
        $param = array();
        $param['keyword'] = $this->input->get('keyword');
        $param['fromdate'] = $this->input->get('fromdate');
        $param['email'] = $this->input->get('email');
        $param['todate'] = $this->input->get('todate');
        $total = $this->user_model->count_all($param);
        $records = $this->user_model->find_all($param,$page, $page_size);
        $page_url = base_url('/cp/users/index');
        $pagination = $this->get_search_paging($page_url, $total, $page, $page_size );

        $data = array(
            "total" => $total,
            "records" => $records,
            "pagination" => $pagination,
            'param'=>$param
        );
		$this->layout->view($data);
	}
	

	
	public function edit(){
		$data = array();
		$this->layout->view('admin/users/edit',$data);
	}

}